<template>
	<view id="localColor">
		<!-- 背景半椭圆 -->
		<view id="background-top" />
		
		<!-- 头部搜索框 -->
		<view class="header">
			<uni-row>
				<uni-col :span="24">
					<uni-search-bar class="searchBar" placeholder="请输入搜索内容" :radius="200" @confirm="toSearch" v-model="searchValue"
						clearButton="auto" cancelButton="none"/>
					
				</uni-col>
			</uni-row>
		</view>
		
		<!-- 广告板块 -->
		<view class="swiper">
			<image src="../../../static/img/swiper/swiper0.jpg" mode="scaleToFill"></image>
		</view>
		
		<!-- 产品介绍 -->
		<view class="product-introduction">
			<view class="product">
				特 色 商 品
			</view>
			<view class="story">
				产 品 故 事
			</view>
		</view>
		
		<!-- 精品推荐 -->
		<view class="recommendation">
			精 品 推 荐
		</view>
		
		<!-- 地方特色产品列表 -->
		<view class="localColor-list">
			
			<!-- 单例 -->
			<view class="localColor-item" v-for="item in 5" :key="item">
				<!-- 地区信息 -->
				<view class="local-info">
					<view class="local-info-img">
						<uni-icons type="" size="80px" color="#3a3a3a"></uni-icons>
					</view>
					<view class="local-info-name">
						· · · 村
					</view>
				</view>
				<!-- 产品展示 -->
				<view class="production-info">
					<view class="production-info-name">
						产品名
					</view>
					<view class="production-info-introduction">
						产品简介
					</view>
					<view class="production-info-more">
						了解详情
						<uni-icons type="right" color="#909399" size="12px"></uni-icons>
					</view>
				</view>
			</view>
		</view>
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 搜索框
				searchValue:"",
			};
		},
		methods:{
			toSearch(){
				
			}
		}
	}
</script>

<style lang="scss" scoped>
	#background-top{
		margin: 0!important;
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 150px;
		background-color: #ec3525;
		border-radius: 0 0 30% 30%;
		z-index: -10;
	}
	
	#localColor{
		margin-top: 10px;
		>view{
			margin: 0 10px;
		}
		
		
		// 广告板块
		.swiper{
			margin-top: 10px;
			border-radius: 10px;
			overflow: hidden;
			
			>image{
				width: 100%;
				height: 150px;
				border-radius: 10px;
			}
		}
		
		// 产品介绍
		.product-introduction{
			margin-top: 10px;
			display: flex;
			justify-content: space-between;
			align-items: center;
			
			>view{
				width: calc(50% - 5px);
				padding: 30px 0;
				font-size: 24px;
				font-weight: bold;
				color: #E43D33;
				text-align: center;
				background-color: rgba($color: #fff, $alpha: 0.5);
				border-radius: 10px;
				box-shadow: 0 0 3px 0 rgba($color: #000000, $alpha: 0.08);
			}
		}
		
		// 精品推荐
		.recommendation{
			margin-top: 10px;
			padding: 10px 0;
			font-size: 20px;
			font-weight: bold;
			text-align: center;
			color: white;
			border-radius: 8px;
			box-shadow: 0 0 3px 0 rgba($color: #000000, $alpha: 0.08);
			background-image: linear-gradient(120deg, #ec3525 0%, #fda085 100%);
		}
		
		// 特色产品列表
		.localColor-list{
			margin: 0;
			margin-top: 10px;
			padding: 20px 10px;
			display: flex;
			align-items: center;
			flex-direction: column;
			background-color: #fff;
			border-radius: 20px 20px 0 0;
			border: 1px solid rgba(0, 0, 0, 0.1);
			box-shadow: 0px -7px 3px -7px rgba(0, 0, 0, 0.08);
			
			.localColor-item{
				padding: 10px 0 5px 0;
				width: 100%;
				display: flex;
				&:nth-child(n+2){
					border-top: 1px solid rgba($color: #000000, $alpha: 0.08);
				}
				
				// 地区信息
				.local-info{
					display: flex;
					justify-content: center;
					align-items: center;
					flex-direction: column;
					margin-right: 20px;
					
					.local-info-img{
						width: 80px;
						height: 80px;
						border-radius: 8px;
						overflow: hidden;
						background-color: #eee;
						image{
							width: 80px;
							height: 80px;
						}
						
						// flex
						display: flex;
						justify-content: center;
						align-items: center;
					}
					.local-info-name{
						font-size: 14px;
						color: #3a3a3a;
						width: 80px;
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;
						text-align: center;
					}
				}
				
				// 产品展示
				.production-info{
					width: 100%;
					height: 100%;
					position: relative;
					.production-info-name{
						width: 100%;
						font-size: 16px;
						font-weight: bold;
						color: #3a3a3a;
						// 两行显示
						overflow: hidden;
						text-overflow: ellipsis;
						display: -webkit-box;
						-webkit-line-clamp:2;
						-webkit-box-orient:vertical;
					}
					.production-info-introduction{
						font-size: 14px;
						margin-top: 5px;
						color: #3A3A3A;
						// 两行显示
						overflow: hidden;
						text-overflow: ellipsis;
						display: -webkit-box;
						-webkit-line-clamp:2;
						-webkit-box-orient:vertical;
					}
					.production-info-more{
						position: absolute;
						right: 0;
						border: 0;
						font-size: 12px;
						// margin-top: 5px;
						color: #909399;
					}
				}
			}
			
		}
	}
</style>

<style lang="scss">
	#localColor{
		.header{
			
			// 搜索框边框
			.uni-searchbar{
				padding: 0;
				
			}
			// 搜索框box
			.uni-searchbar__box{
				height: 30px;
				box-shadow: 0 0 3px 0 rgba($color: #000000, $alpha: 0.08);
			}
			
			// 咨询按钮
			.consult {
				display: flex;
				align-items: center;
				justify-content: center;
				width: 100%;
				height: 30px;
				line-height: 30px;
				text-align: center;
				color: #3A3A3A;
				font-weight: bold;
			}
		}
	}
</style>

<!-- <template>
 	<view class="container">
 		<editor id="editor" class="ql-container" :placeholder="placeholder" @ready="onEditorReady"></editor>
 		<button type="warn" @tap="undo">撤销</button>
 	</view>
 </template>
 
 <script>
 	export default {
 		data() {
 			return {
 				placeholder: '开始输入...'
 			}
 		},
 		methods: {
 			onEditorReady() {
 			    // #ifdef MP-BAIDU
 			    this.editorCtx = requireDynamicLib('editorLib').createEditorContext('editorId');
 			    // #endif
 			    
 			    // #ifdef APP-PLUS || H5 ||MP-WEIXIN
 			    uni.createSelectorQuery().select('#editor').context((res) => {
 			      this.editorCtx = res.context
 			    }).exec()
 			    // #endif
 			},
 			undo() {
 				this.editorCtx.undo()
 			}
 		}
 	}
 </script>
 
 <style>
 	.container {
 		padding: 10px;
 	}
 
 	#editor {
 		width: 100%;
 		height: 300px;
 		background-color: #CCCCCC;
 	}
 
 	button {
 		margin-top: 10px;
 	}
 </style> -->